<template>
<!-- 经纪人页面 -->
  <div>
       <!-- 顶部的蓝色导航 -->
    <uni-nav-bar  title="经纪人" class="navbar" backgroundColor="#1482f5" statusBar="true" color="white">
        <view slot="left">
        <text class="iconfont icon-left" @click="yback"></text>
        </view>
    </uni-nav-bar>
    <!-- 前三名的榜单 -->
    <div class="ranking">
        <div class="rankinglist" v-for="item in top" :key="item.brokerid">
            <div>
                <img :src="item.brokerimg" alt="">
            </div>
            <span>{{item.bname}}</span>
        </div>
    </div>
    <!-- 其余人 -->
    <div class="redundant">
        <div class="redundantlist" v-for="item in agents" :key="item.brokerid">
           <div class="redundantleft">
                <div class="redundantimg">
                <img :src="item.brokerimg" alt="">
                </div>
                <span>{{item.bname}}</span>
           </div>
           <div class="redundantright">
               <span class="outside" style="margin-right: 10px;"><span class="iconfont icon-xiaoxi" style="font-size:20px;color: #f46767;"></span></span>
               <span  class="outside"><span class="iconfont icon-dianhua1" style="font-size:15px;color: #f46767;"></span></span>
               
               
           </div>
        </div>
    </div>
  </div>
</template>

<script>
import {uniNavBar} from '@dcloudio/uni-ui';
import {getagent} from "../../services"
export default {
components: {uniNavBar},
data() {
    return {
        agents:[],
        top:[],
    }
},
methods: {
      // 返回
      yback(){
     wx.navigateBack()
  },
},
async created() {
    let data=await getagent({
        page:1,
        pcount:15,
    });
    console.log(data.data.list.splice(0,3));
    this.top=data.data.list.splice(0,3);
    this.agents=data.data.list;
},
}
</script>

<style lang="scss">
@import "../../y_icon/iconfont.css";
.redundant{
    display: flex;
    flex-direction: column;
    padding: 0 20px;
    .redundantlist{
        display: flex;
        padding: 10px 0;
        align-items: center;
        justify-content: space-between;
        border-bottom: 1px solid #000;
        .redundantleft{
            width: 120px;
            align-items: center;
            display: flex;
            .redundantimg{
                width: 50px;
                height: 50px;
                overflow: hidden;
                border-radius: 50%;
                margin-right: 5px;
                img{
                    width: 50px;
                    height: 80px;

                }
            }
        }
        .redundantright{
            width: 60px;
            display: flex;
            align-items: center;
            .outside{
                width: 30px;
                height: 30px;
                display: flex;
                align-items: center;
                justify-content: center;
                background-color: #fdeded;
                border-radius: 50%;
            }
        }
    }
}
.ranking{
    width: 100%;
    height: 150px;
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    .rankinglist:nth-child(2){
        height: 130px;
    }
    .rankinglist{
        width: 60px;
        height: 100px;
        background-color: aqua;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        div{
            width: 50px;
            height: 50px;
            border-radius: 50%;
            overflow: hidden;
            img{
            width: 50px;
            height: 80px;
        }
        }
    }
}
</style>